// 实现搜索功能
let key = getUrlParams('key');
$.ajax({
    type: 'get',
    url: '/posts/search/' + key,
    success: function (response) {
        console.log(response);
        let html = template('searchTpl', {
            data: response
        });
        $('#listBox').html(html);
    }
})